/*
 * Copyright (C) 2018 Baidu, Inc. All Rights Reserved.
 */
package com.jzh.selfwallpaper.view.widget;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by jzh on 2018/1/24.
 */

public class SpaceItemDecoration extends RecyclerView.ItemDecoration {

    private int space;

    public SpaceItemDecoration(int space) {
        this.space = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        //if(parent.getChildAdapterPosition(view)!=0)
            outRect.right=space;
    }
}
